home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / dev / vmelink.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  3KB  |  99 lines

  1. /*
  2.  * vmelink.h --
  3.  *
  4.  *    Declarations of interface to the Bit-3 VME link driver routines.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/lib/include/dev/RCS/vmelink.h,v 1.1 90/12/05 12:25:40 elm Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _VMELINK
  19. #define _VMELINK
  20.  
  21. /*
  22.  * Size of the VME link useful address space in pages.
  23.  */
  24. #define VMELINK_VME_START_ADDR        0xff400000
  25. #define VMELINK_VME_ADDR_SIZE        0x00020000
  26. #define VMELINK_NUM_PAGES        (VMELINK_VME_ADDR_SIZE / PAGSIZ)
  27.  
  28. /*
  29.  * Flags used to set the local command register.
  30.  */
  31. #define VMELINK_CLEAR_LOCAL_ERRS    0x80
  32. #define VMELINK_CLEAR_LOCAL_PF_INT    0x40
  33. #define VMELINK_SET_REMOTE_PT_INT    0x20
  34. #define VMELINK_DISABLE_LOCAL_INT    0x04
  35.  
  36. /*
  37.  * Flags in the status registers.
  38.  */
  39. #define VMELINK_PARITY_ERROR        0x80
  40. #define VMELINK_REMOTE_BUSERR        0x40
  41. #define VMELINK_LOCAL_PR_INT        0x20
  42. #define VMELINK_LOCAL_PT_INT        0x02
  43. #define VMELINK_REMOTE_DOWN        0x01
  44.  
  45. /*
  46.  * Flags used to set remote command register 1.
  47.  */
  48. #define VMELINK_REMOTE_RESET        0x80
  49. #define VMELINK_CLEAR_REMOTE_PT_INT    0x40
  50. #define VMELINK_SET_REMOTE_PR_INT    0x20
  51. #define VMELINK_LOCK_VME        0x10
  52. #define VMELINK_USE_PAGE_REG        0x08
  53.  
  54. /*
  55.  * Flags used to set remote command register 2.
  56.  */
  57. #define VMELINK_REMOTE_USE_ADDRMOD    0x40
  58. #define VMELINK_REMOTE_BLKMODE_DMA    0x20
  59. #define VMELINK_DISABLE_REMOTE_INT    0x10
  60.  
  61. /*
  62.  * Window size flags (for IOC_VMELINK_SET_WINDOW_SIZE IO control).
  63.  */
  64. #define VMELINK_WINDOW_SIZE_64K        0x00
  65. #define VMELINK_WINDOW_SIZE_128K    0x01
  66. #define VMELINK_WINDOW_SIZE_256K    0x03
  67. #define VMELINK_WINDOW_SIZE_512K    0x07
  68. #define VMELINK_WINDOW_SIZE_1M        0x0f
  69.  
  70. /*
  71.  * Used in the IOControl status call.
  72.  */
  73. typedef struct VMElinkStatus {
  74.     int LocalStatus;
  75.     int RemoteStatus;
  76. } VMElinkStatus;
  77.  
  78. /*
  79.  * Structure used to map VME bus addresses into kernel memory.
  80.  */
  81. typedef struct VMElinkMapRequest {
  82.     void *VMEAddress;        /* VME address to map */
  83.     int mapSize;        /* number of bytes to map in */
  84.     void *kernelAddress;    /* resulting kernel address */
  85. } VMElinkMapRequest;
  86.  
  87. #define IOC_VMELINK            (13 << 16)
  88.  
  89. #define IOC_VMELINK_STATUS        (IOC_VMELINK | 0x1)
  90. #define IOC_VMELINK_PING_REMOTE        (IOC_VMELINK | 0x3)
  91. #define IOC_VMELINK_MAP_MEMORY        (IOC_VMELINK | 0x4)
  92. #define IOC_VMELINK_NO_ADDRMOD        (IOC_VMELINK | 0x5)
  93. #define IOC_VMELINK_SET_ADDRMOD        (IOC_VMELINK | 0x6)
  94. #define IOC_VMELINK_NO_WINDOW        (IOC_VMELINK | 0x7)
  95. #define IOC_VMELINK_SET_WINDOW        (IOC_VMELINK | 0x8)
  96. #define IOC_VMELINK_SET_WINDOW_SIZE    (IOC_VMELINK | 0x9)
  97.  
  98. #endif /* _VMELINK */
  99.